package ar.uba.fi.tonyvaliente.tree;

import java.util.BitSet;
import ar.uba.fi.tonyvaliente.persistors.BitSetPersistor;
import ar.uba.fi.tonyvaliente.persistors.IntegerPersistor;
import ar.uba.fi.tonyvaliente.utils.io.ByteCompletionMode;

public class BTreeNodeMoveTest {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		try {
			BTree<Integer, BitSet> tree;
			tree = new DiskBTree<Integer, BitSet>(4, "/home/dmorello/btree.dat",
					new IntegerPersistor(), new BitSetPersistor(ByteCompletionMode.NONE));
//			tree = new DiskBTree<Integer, BitSet>("/home/dmorello/btree.dat", false,
//					new IntegerPersistor(), new BitSetPersistor(ByteCompletionMode.NONE));
			
			BitSet bs1 = new BitSet(5000);
			tree.add(1, bs1);
			tree.add(100, bs1);
			tree.add(50, bs1);
			tree.add(103, bs1);
			tree.add(24, bs1);
			
			tree.close();
			
			tree = new DiskBTree<Integer, BitSet>("/home/dmorello/btree.dat", false,
			new IntegerPersistor(), new BitSetPersistor(ByteCompletionMode.NONE));
			
			tree.add(2, new BitSet(40000));
			tree.add(105, new BitSet(49160));
			
			tree.close();
			
			BTreeFileInspector.main(new String[]{"/home/dmorello/btree.dat"});
			
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
